package mapper;

import domain.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface UserMapper {
    @Insert("INSERT into user VALUES(null,#{username},#{password},#{money})")
    @Options(useGeneratedKeys = true,keyProperty = "uid")
     int Zhuce(User user);
    @Select("select * from user where username=#{username} and password=#{password}")
    User login(@Param("username") String username, @Param("password") String password);
    @Select("select * from user")
    List<User> findAll();
    @Update("update user set username=#{username},password=#{password},money=#{money} where uid=#{uid}")
    int updateUser(User user);
    @Select("select * from user where uid=#{uid}")
    User findByUid(int uid);
    @Delete("delete from  user where  uid=#{uid}")
    int deleteByUid(int uid);
}
